services:
  agent:
    command: sh -c 'bin/wait && python -m deeppavlov_agent.run agent.pipeline_config=assistant_dists/deepy_base/pipeline_conf.json'
    volumes:
      - ".:/dp-agent"
    environment:
      WAIT_HOSTS: "spelling-preprocessing:8074, harvesters-maintenance-skill:3662, confidence-based-response-selector:8005,
        emotion-classification-deepy:8015, dff-program-y-skill:8008"
      WAIT_HOSTS_TIMEOUT: ${WAIT_TIMEOUT:-480}
    ports:
      - 4242:4242

  spelling-preprocessing:
    env_file: [ .env ]
    build:
      args:
        SERVICE_PORT: 8074
        SERVICE_NAME: spelling_preprocessing
      context: ./annotators/spelling_preprocessing/
    command: flask run -h 0.0.0.0 -p 8074
    environment:
      - FLASK_APP=server
    deploy:
      resources:
        limits:
          memory: 100M
        reservations:
          memory: 100M
    ports:
      - 8074:8074

  harvesters-maintenance-skill:
    build:
      context: skills/harvesters_maintenance_skill_deepy
    command: gunicorn --workers=1 server:app -b 0.0.0.0:3662
    volumes: []
    ports:
      - 3662:3662

  confidence-based-response-selector:
    build:
      context: response_selectors/confidence_based_response_selector
    command: gunicorn --workers=1 server:app -b 0.0.0.0:8005
    volumes: []
    ports:
      - 8005:8005

  emotion-classification-deepy:
    build:
      context: annotators/emotion_classification_deepy
    command: python -m deeppavlov riseapi emo_bert.json -p 8015
    ports:
      - 8015:8015

  dff-program-y-skill:
    env_file: [ .env ]
    build:
      args:
        SERVICE_PORT: 8008
        SERVICE_NAME: dff_program_y_skill
        LANGUAGE: EN
      context: .
      dockerfile: ./skills/dff_program_y_skill/Dockerfile
    command: gunicorn --workers=1 server:app -b 0.0.0.0:8008 --reload
    ports:
      - 8008:8008

version: "3.7"
